<extend name="Common:common"/>
<block name="main">

    <div class="main-content">
        <div class="breadcrumbs" id="breadcrumbs">
            <script type="text/javascript">
                try {
                    ace.settings.check('breadcrumbs', 'fixed')
                } catch (e) {
                }
            </script>

            <ul class="breadcrumb">
                <li>
                    <i class="icon-home home-icon"></i>
                    <a href="#"> 云系统管理平台</a>
                </li>

                <li>
                    <a href="#">系统基本信息</a>
                </li>
                <li class="active">系统设置</li>
            </ul>
            <!-- .breadcrumb -->

            <div class="nav-search" id="nav-search">
                <a href="{:U('AdminUser/createadminuser')}" class="btn btn-xs btn-success"><i class="icon-plus icon-white"></i>添加新用户</a>
            </div>
            <!-- #nav-search -->
        </div>

        <div class="page-content">
            <h1>{$title}</h1>
            <hr/>
            <div id="main" style="width: 1024px;height:400px;"></div>

        </div>
       </div><!-- /.page-content -->
    </div><!-- /.main-content -->
    <script src="__PUBLIC__/Common/static/js/echarts.common.min.js"></script>
    <script type="text/javascript">
        var $URL = "__APP__/Home/ECharts/";
        var myChart = echarts.init(document.getElementById('main'));
        // 显示标题，图例和空的坐标轴
        myChart.setOption({
            title: {
                text: "{$product_name}"
            },
            tooltip: {},
            legend: {
                data:["{$name}"]
            },
            xAxis: {
                data: []
            },
            yAxis: {},
            series: [{
                name: "{$name}",
                type: 'bar',
                data: []
            }]
        });
        // 异步加载数据
        //ECharts 默认有提供了一个简单的加载动画。只需要调用 showLoading 方法显示。数据加载完成后再调用 hideLoading 方法隐藏加载动画。
        myChart.showLoading();
        $.get($URL+'getJson').done(function (data) {
            console.log($.parseJSON(data));
            $data = $.parseJSON(data);
            myChart.hideLoading();
            // 填入数据
            myChart.setOption({
                xAxis: {
                    data: $data.categories
                },
                series: [{
                    // 根据名字对应到相应的系列
                    name: "{$name}",
                    data: $data.data
                }]
            });
        });
    </script>
</block>
